package com.xiaoran.boot;

import com.sun.org.apache.xpath.internal.operations.Bool;
import com.xiaoran.boot.bean.Car;
import com.xiaoran.boot.bean.Cat;
import com.xiaoran.boot.bean.Stander;
import com.xiaoran.boot.bean.User;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;

@SpringBootApplication//标识当前类是主程序类，也可以说是我们的启动类
//@Import({Cat.class})
public class MainApplication {
    public static void main(String args[]){
        ConfigurableApplicationContext run=SpringApplication.run(MainApplication.class,args);
    //    Cat cat=run.getBean(Cat.class);
  /*    System.out.println(cat.toString());
         boolean cat= run.containsBean("cat");
        System.out.println("cat："+cat);

        boolean user01=run.containsBean("user");
        System.out.println("容器中的User："+user01);

       Cat cat1= (Cat) run.getBean("haha");
       System.out.println(cat1.getName());
       */
    Stander stander=(Stander) run.getBean("stander");
    stander.setNaem("小米");
    System.out.println(stander.toString());

    }

}
